<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>订单详情</title>
    <link rel="icon" href="assets/img/favicon.ico">

    <link rel="stylesheet" type="text/css" href="css/webbase.css"/>
    <link rel="stylesheet" type="text/css" href="css/pages-seckillOrder.css"/>
</head>

<body>

<!--页面顶部白条条，由js动态加载-->
<script type="text/javascript" src="plugins/jquery/jquery.min.js"></script>
<div class="nav-bottom"></div>
<script type="text/javascript">$(".nav-bottom").load("top.html");</script>

<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#service").hover(function () {
            $(".service").show();
        }, function () {
            $(".service").hide();
        });
        $("#shopcar").hover(function () {
            $("#shopcarlist").show();
        }, function () {
            $("#shopcarlist").hide();
        });

    })
</script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="js/widget/nav.js"></script>
</body>
<!--header-->
<div id="account">
    <div class="py-container">
        <div class="yui3-g home">
            <!--左侧列表-->
            <div class="yui3-u-1-6 list">

                <div class="person-info">
                    <div class="person-photo"><img src="http://image.ego.com/group1/M00/00/00/wKiOgF34pXKAHZTXAADU4k_VGNE713.JPG" width="48" height="48" alt=""></div>
                    <div class="person-account">
                        <span class="name">{{user.username}}</span>
                        <span class="safe">账户安全</span>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="list-items">
                    <dl>
                        <dt><i>·</i> 订单中心</dt>
                        <dd><a href="home-index.html" class="list-active">我的订单</a></dd>
                        <dd><a href="home-order-pay.html">待付款</a></dd>
                        <dd><a href="home-order-send.html">待发货</a></dd>
                        <dd><a href="home-order-receive.html">待收货</a></dd>
                        <dd><a href="home-order-evaluate.html">待评价</a></dd>
                    </dl>
                    <dl>
                        <dt><i>·</i> 我的中心</dt>
                        <dd><a href="home-person-collect.html">我的收藏</a></dd>
                        <dd><a href="home-person-footmark.html">我的足迹</a></dd>
                    </dl>
                    <dl>
                        <dt><i>·</i> 物流消息</dt>
                    </dl>
                    <dl>
                        <dt><i>·</i> 设置</dt>
                        <dd><a href="home-setting-info.html">个人信息</a></dd>
                        <dd><a href="home-setting-address.html">地址管理</a></dd>
                        <dd><a href="home-setting-safe.html">安全管理</a></dd>
                    </dl>
                </div>
            </div>
            <!--右侧主内容-->
            <div class="yui3-u-5-6">
                <div class="body">
                    <div class="order-detail">
                        <h4>订单详情</h4>
                        <div class="order-bar">
                            <div class="sui-steps-round steps-round-auto steps-4">
                                <div class="finished">
                                    <div class="wrap">
                                        <div class="round">1</div>
                                        <div class="bar"></div>
                                    </div>
                                    <label>
                                        <span>提交订单</span>
                                        <span>2016-06-27</span>
                                        <span>13:03:53</span>
                                    </label>
                                </div>
                                <div class="current">
                                    <div class="wrap">
                                        <div class="round">2</div>
                                        <div class="bar"></div>
                                    </div>
                                    <label>
                                        <span>付款成功</span>
                                        <span>2016-06-27</span>
                                        <span>13:03:53</span>
                                    </label>
                                </div>
                                <div class="todo">
                                    <div class="wrap">
                                        <div class="round">3</div>
                                        <div class="bar"></div>
                                    </div>
                                    <label>
                                        <span>发货</span>
                                        <span>2016-06-27</span>
                                        <span>13:03:53</span>
                                    </label>
                                </div>
                                <div class="todo">
                                    <div class="wrap">
                                        <div class="round">4</div>
                                        <div class="bar"></div>
                                    </div>
                                    <label>
                                        <span>确认收货</span>
                                        <span>2016-06-27</span>
                                        <span>13:03:53</span>
                                    </label>
                                </div>

                                <div class="todo last">
                                    <div class="wrap">
                                        <div class="round">5</div>
                                    </div>
                                    <label>
                                        <span>评价晒单</span>
                                        <span>2016-06-27</span>
                                        <span>13:03:53</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="order-state">
                            <p>当前订单状态：<span class="red">已发货</span></p>
                            <p>还剩06天00小时 自动确认收货</p>
                        </div>
                    </div>
                    <div class="order-info">
                        <h5>订单信息</h5>
                        <p>收货地址：神茶减肥茶就观察及噶盘滚啊 </p>
                        <p>订单单号：178789758976986</p>
                        <p>下单时间：2017-06-04 09：03：03</p>
                        <p>支付时间：2017-06-05 09：03：03</p>
                        <p>支付方式：微信</p>
                        <p>发货时间：201707-06-06 09：03：03</p>
                    </div>
                    <div class="order-goods">
                        <table class="sui-table">
                            <thead>
                            <th class="center">商品</th>
                            <th class="center">价格</th>
                            <th class="center">数量</th>
                            <th class="center">优惠</th>
                            <th class="center">状态</th>
                            </thead>

                            <tbody>
                            <tr>
                                <td colspan="5">订单编号：{{orderId}}</td>
                            </tr>
                            <tr v-for="(k,v) in order.orderDetails">
                                <td>
                                    <div class="typographic"><img :src="k.image" width="82" height="82"/>
                                        <span>{{k.title}}</span>
                                        <!--<span class="guige">规格：温泉喷雾150ml</span>-->
                                    </div>
                                </td>
                                <td>
                                    <ul class="unstyled">
                                       <!-- <li class="o-price"></li>-->
                                        <li>¥{{formatPrice(k.price)}}</li>
                                    </ul>
                                </td>
                                <td>{{k.num}}</td>
                                <td>无优惠</td>
                                <td v-if="order.orderStatus.status === 1">等待买家付款</td>
                                <td v-if="order.orderStatus.status === 2">已付款</td>
                                <td v-if="order.orderStatus.status === 3">已发货</td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="order-price">
                            <p>商品总金额：￥{{formatPrice(order.actualPay)}}</p>
                            <p>运费金额：免费用</p>
                            <p>使用优惠券：无</p>
                            <h4 class="red">实际支付：￥{{formatPrice(order.actualPay)}}</h4>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <!--猜你喜欢-->
                    <div class="like-title">
                        <div class="mt">
                            <span class="fl"><strong>热卖单品</strong></span>
                        </div>
                    </div>
                    <div class="like-list">
                        <ul class="yui3-g">
                            <li class="yui3-u-1-4">
                                <div class="list-wrap">
                                    <div class="p-img">
                                        <img src="img/_/itemlike01.png"/>
                                    </div>
                                    <div class="attr">
                                        <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                    </div>
                                    <div class="price">
                                        <strong>
                                            <em>¥</em>
                                            <i>3699.00</i>
                                        </strong>
                                    </div>
                                    <div class="commit">
                                        <i class="command">已有6人评价</i>
                                    </div>
                                </div>
                            </li>
                            <li class="yui3-u-1-4">
                                <div class="list-wrap">
                                    <div class="p-img">
                                        <img src="img/_/itemlike02.png"/>
                                    </div>
                                    <div class="attr">
                                        <em>Apple苹果iPhone 6s/6s Plus 16G 64G 128G</em>
                                    </div>
                                    <div class="price">
                                        <strong>
                                            <em>¥</em>
                                            <i>4388.00</i>
                                        </strong>
                                    </div>
                                    <div class="commit">
                                        <i class="command">已有700人评价</i>
                                    </div>
                                </div>
                            </li>
                            <li class="yui3-u-1-4">
                                <div class="list-wrap">
                                    <div class="p-img">
                                        <img src="img/_/itemlike03.png"/>
                                    </div>
                                    <div class="attr">
                                        <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                    </div>
                                    <div class="price">
                                        <strong>
                                            <em>¥</em>
                                            <i>4088.00</i>
                                        </strong>
                                    </div>
                                    <div class="commit">
                                        <i class="command">已有700人评价</i>
                                    </div>
                                </div>
                            </li>
                            <li class="yui3-u-1-4">
                                <div class="list-wrap">
                                    <div class="p-img">
                                        <img src="img/_/itemlike04.png"/>
                                    </div>
                                    <div class="attr">
                                        <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                    </div>
                                    <div class="price">
                                        <strong>
                                            <em>¥</em>
                                            <i>4088.00</i>
                                        </strong>
                                    </div>
                                    <div class="commit">
                                        <i class="command">已有700人评价</i>
                                    </div>
                                </div>
                            </li>

                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 底部栏位 -->
<!--页面底部，由js动态加载-->
<div class="clearfix footer"></div>
<script type="text/javascript">$(".footer").load("foot.html");</script>
<script src="./js/vue/vue.js"></script>
<script src="./js/axios.min.js"></script>
<script src="./js/common.js"></script>
<script src="./js/plugins/jquery/jquery.cookie.js"></script>
<!--页面底部END-->
<script type="text/javascript">
    var vm = new Vue({
        el: "#account",
        data: {
            orderId: 0,
            user:{},
            order: {}
        },
        components: {
            egoTop: () => import('./js/pages/top.js')
        },
        created() {
            //加载数据
            this.loadOrder();
        },
        methods: {
            loadOrder() {
                this.orderId = ego.getUrlParam("orderId");
                ego.http.get("/auth/verify").then(resp => {

                    // 查询用户信息
                    this.user = resp.data;
                    // 查询订单信息
                    ego.http.get("/order/order/" + this.orderId)
                        .then(resp => {
                            this.order = resp.data;
                        }).catch(() => this.orders = [])

                }).catch(() => {
                    this.gotoLogin();
                });
            },
            formatDate: ego.formatDate,
            formatPrice: ego.formatPrice,
            getTotalPrice(order) {
                return order.orderDetails.map(d => d.num * d.price).reduce((v1, v2) => v1 + v2, 0);
            },
            logout() {
                Cookies.remove("EGO_TOKEN", {
                    path: "/",
                    domain: "ego.com"
                });
                window.location = 'http://www.ego.com'
            },
            gotoLogin() {
                window.location = "login.html?returnUrl=" + window.location;
            }
        },
    });
</script>

</html>
